import VueRouter from "vue-router";
import Vue from "vue";

//旅发

import table from "../components/park/table01.vue"
import dataPanel from "../components/park/dataPanel.vue"
import parkIndex from "../view/park/index/index.vue" //路由页面
import parkHome from "../view/park/home/index.vue" //总览
import parkSecurity from "../view/park/security/index.vue" //安防
import parkGeneral from "../view/park/general/index.vue"  //通行
import parkEnergy from "../view/park/energy/index.vue" //能源
import parkItem from "../view/park/item/index.vue" //设备
import parkProperty from "../view/park/property/index.vue" //物业

//边坡
import test from "../view/slope/home/components/devicePopUp/DevicePopUp.vue"
import soleIndex from "../view/slope/index/index.vue"
import soleHome from "../view/slope/home/index.vue"
// import soleMap from "../view/slope/map/index.vue"
import soleMap from "../view/slope/home-map/index.vue"
//vue-router路由组件
Vue.use(VueRouter)
//定义路由表
const routes = [
  { path: '/table', component: table },
  { path: '/dataPanel', component: dataPanel },
  // 旅发路由
  {
    path: '/park',
    component: parkIndex,
    redirect: '/parkHome',
    children: [
      { path: '/parkHome', component: parkHome },
      { path: '/parkSecurity', component: parkSecurity },
      { path: '/parkGeneral', component: parkGeneral },
      { path: '/parkEnergy', component: parkEnergy },
      { path: '/parkItem', component: parkItem },
      { path: '/parkProperty', component: parkProperty },
    ]
  },

  { path: '/test', component: test },
  // 边坡路由
  {
    path: '/',
    component: soleIndex,
    redirect: '/soleMap',
    children: [
      { path: '/soleHome', component: soleHome },
      { path: '/soleMap', component: soleMap }
    ]
  }

]



// 创建路由器实例，并且传入`routes`变量作为路由。
const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
